package net.fpeg.kotlin.msa.wordbase.service

import org.junit.jupiter.api.Test

import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import javax.transaction.Transactional

@SpringBootTest
internal class WordSourceServiceTest {

    @Autowired
    lateinit var wordSourceService: WordSourceService

    @Test
    fun get() {
//        wordSourceService.add(17, 1, "asdx")
        val x = wordSourceService.get(4)
    }

    @Test
    fun edit() {
        wordSourceService.remove(-1, 2)

//        wordSourceService.edit(-1, 2, "gga")
    }

    @Test
    fun delete() {
        wordSourceService.remove(-1, 2)
    }
    @Test
    @Transactional
    fun getTree(){
        val x = wordSourceService.getTree(12333)
        print(x.id)
    }

    @Test
    @Transactional
    fun findIds(){
        val x = wordSourceService.findIds(4)
        println(x.size)
    }
}